package com.ruoyi.consumer.aop.convert;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class DefaultConvertStrategy {

    @Autowired
    private IndividualOperateStrategy individualUserStrategy;

    @Autowired
    private CorporateOperateStrategy corporateUserStrategy;

    @Autowired
    private WxOrderOperateStrategy wxOrderOperateStrategy;

    public ConvertStrategy getStrategy(String desc) {
        if ("个人钱包小订单加注".equals(desc) || "个人下单".equals(desc)) {
            return individualUserStrategy;
        } else if ("公司钱包小订单加注".equals(desc) || "公司下单".equals(desc)) {
            return corporateUserStrategy;
        } else if ("微信下单".equals(desc) || "微信小订单".equals(desc)) {
            return wxOrderOperateStrategy;
        } else {
            throw new IllegalArgumentException("Unknown user type: " + desc);
        }
    }


}
